package com.hzit.validator;

import org.omg.CORBA.INTERNAL;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import java.util.HashSet;
import java.util.Set;

/**
 * 类名：
 * 作者：WF
 * 功能：自定义校验器,用于验证规格选项的值必须在1-10之间
 */
public class OrderConstraintValidator implements ConstraintValidator<OrderValidator,Integer> {
	// private Set<Integer> set = new HashSet<>();
	@Override
	public void initialize(OrderValidator constraintAnnotation) {

	}

	@Override
	public boolean isValid(Integer value, ConstraintValidatorContext context) {
		return value <= 10 && value >= 1;
	}
}
